from likeshop_api_project.base.mybase import Tools


class login_model(Tools):

    path = '/api/account/login'

    def login_action(self, account, password, client):
        login_data = {
            "account": account,
            "password": password,
            "client": client
        }
        login = self.huihua.post(url=self.hosturl+self.path, data=login_data)
        return login.json()


if __name__ == '__main__':
    import requests

    s = requests.session()
    reg = login_model(huihua=s)
    msg = reg.login_action(account="13356786546", password="rr98765", client=2)
    print(msg)
    get_token = msg["data"]["token"]
    print(get_token)
